package com.java2_22;

import java.util.ArrayList;
import java.util.Scanner;

public class java2_22 {
    //    public static void main(String[] args) {
//        Scanner sc = new Scanner(System.in);
//        System.out.print("请输入字符串：");
//        String str = sc.next();
//        StringBuilder sb = new StringBuilder();
//        sb.append(str);
//        StringBuilder reverseString = sb.reverse();
//        System.out.println(str.equals(reverseString.toString()) ? "YES" : "NO");
//
//    }
//    public static void main(String[] args) {
////        String str = "hello world";
////        int index = str.indexOf(97);
////        System.out.println(index);
////
////        int index1 = str.indexOf("llo");
////        System.out.println(index1);
////
////        System.out.println(str.indexOf("llo", 5));
////        System.out.println(str.indexOf(101, 1));
//
////        String str = "Java语言是面向对象的，Java语言是健壮的，Java语言是安全的，Java是高性能的，Java语言是跨平台的";
////        int count = 0;
////        while(str.contains("Java")){
////            int index = str.indexOf("Java");
////            count++;
////            str = str.substring(index + 4);
////        }
////        System.out.println(count);
//
//
//    }
//    public static void main(String[] args) {
//        Employee e1 = new Employee("zhangsan", 3000);
//        Employee e2 = new Employee("lisi", 3500);
//        Employee e3 = new Employee("wangwu", 4000);
//        Employee e4 = new Employee("zhaoliu", 4500);
//        Employee e5 = new Employee("tianqi", 5000);
//
//        //添加
//        ArrayList<Employee> list = new ArrayList<>();
//        list.add(e1);
//        list.add(e2);
//        list.add(e3);
//        list.add(e4);
//        list.add(e5);
//
//        findEmployee(list);
//        deleteEmployee(list);
//
//        e5.setSalary(e5.getSalary()+500);
//
//        for (int i = 0; i < list.size(); i++) {
//            Employee employee = list.get(i);
//            System.out.println(employee.toString());
//        }
//
//    }
//
//    public static void findEmployee(ArrayList<Employee> list) {
//        for (int i = 0; i < list.size(); i++) {
//            Employee employee = list.get(i);
//            System.out.println(employee.toString());
//            System.out.println(list.get(i).toString());
//            if (employee.getName().equals("wangwu")) {
//                employee.setName("wangxiaowu");
//                list.set(i,employee);
//            }
//        }
//    }
//
//    public static void deleteEmployee(ArrayList<Employee> list){
//        for (int i = 0; i < list.size(); i++) {
//            Employee employee = list.get(i);
//            if(employee.getName().equals("zhaoliu")){
//                employee = null; //传值调用不改变实参数值
//            }
//        }
//    public static void main(String[] args) {
////        ArrayList<Integer> list = new ArrayList<>();
////        for (int i = 1; i <= 10; i++) {
////            list.add(i);
////        }
////        //list可以直接打印 -- 带有[]和逗号
////        System.out.println(list);
////        for (int i = 0; i < list.size(); i++) {
////            System.out.print(list.get(i) + " ");
////        }
////        ArrayList<Integer> list = new ArrayList<>();
////        for (int i = 1; i <= 10; i++) {
////            list.add(i);
////        }
//        //list不可以直接进行遍历删除
////        for (int i = 0; i < list.size(); i++) {
////            list.remove(i--);
////        }
////        System.out.println(list);
////        ArrayList<Integer> list = new ArrayList<>();
////        for (int i = 1; i <= 10; i++) {
////            list.add(i);
////        }
////        //list删除倒着删除
////        for (int i = list.size() - 1; i >= 0; i--) {
////            list.remove(i);
////        }
////        System.out.println(list);
////        java也有传值调用和传指调用
//
//
//    }
//    public static final String ADD = "1";
//    public static final String SEARCHALL = "2";
//    public static final String SEARCHONE = "3";
//    public static final String DELETE = "4";
//    public static final String CHANGE = "5";
//    public static final String EXIT = "0";
//
//    public static void main(String[] args) {
//        Scanner sc = new Scanner(System.in);
//        ArrayList<Book> list = new ArrayList<>();
//        System.out.println("欢迎使用图书管理系统，该系统有如下操作");
//        System.out.println("1.添加图书");
//        System.out.println("2.查询所有图书");
//        System.out.println("3.查询目标图书");
//        System.out.println("4.删除图书");
//        System.out.println("5.修改图书信息");
//        System.out.println("0.退出系统");
//        System.out.print("请输入您所需的操作：");
//        String input = sc.next();
//        switch (input) {
//            case ADD:
//                System.out.print("请输入添加图书编号：");
//                add(list, sc.nextInt(), sc);
//                break;
//            case SEARCHALL:
//                break;
//            case SEARCHONE:
//                break;
//            case DELETE:
//                break;
//            case CHANGE:
//                break;
//            case EXIT:
//                break;
//        }
//    }
//
//    public static void add(ArrayList<Book> list, int index, Scanner sc) {
//            if (list.size() == 0) {
//                Book book = new Book();
//                System.out.println("请输入图书名字：");
//                book.setName(sc.next());
//                System.out.println("请输入图书价格：");
//                book.setPrice(sc.nextDouble());
//                book.setIndex(index);
//                System.out.println("图书添加成功！！！");
//            }
//
//        }
//
//    }
//    public static void main(String[] args) {
//        //创建一个空字符串
////        String str = new String();
////        System.out.println(str);
//
//
//    }//java的switch可以使用字符串来作为判断标志
//list.size()默认值是0
//    public static void main(String[] args) {
//        Telephone t = new Telephone();
//        t.setBrand("小米");
//        t.setPrice(2999);
//        t.setColor("深蓝");
//        t.call();
//        t.sendMessage();
//    }
//    public static void main(String[] args) {
//        Girlfriend g = new Girlfriend("071",170,128);
//        g.wash();
//        g.cook();
//        g.show();
//    }
    public static void main(String[] args) {
        //虚方法表 ！= private + static + final
        Teacher t = new Teacher();
        System.out.println(t.toString());


    }


}